import React, { Component } from 'react';
import './style.scss'
class Index extends Component {
  static defaultProps = {
    title: '默认标题'
  }
  render() {
    const { visible, okModel, closeModel, title, children } = this.props
    return (  
      <div className="modal" style={{ display: visible ? 'block': 'none' }}>
        <div className="content">
          <h3>
            <span>{ title }</span>
            <span onClick={ closeModel }>X</span>
          </h3>
          <div className="con">
            { children }
          </div>
          <p>
            <button onClick={ () => closeModel() }>取消</button>
            <button onClick={ () => okModel() }>确定</button>
          </p>
        </div>
      </div>
    );
  }
}

export default Index;
